package com.briup.web.controller;

import com.briup.pojo.response.Result;
import com.briup.service.UploadService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * @author pgc
 * @Description:
 * @date 2024/11/5 16:03
 */
@Api(tags = "文件上传模块接口")
@RestController
public class UploadController {
    @Autowired
    UploadService mUploadService;

    @ApiOperation(value = "上传图片")
    @PostMapping("upload")
    public Result<String> upload(@RequestPart MultipartFile img){
        String url = mUploadService.upload(img);
        return Result.success(url);
    }
}
